package com.xc.controller.agent;

import com.xc.common.ServerResponse;
import com.xc.service.IUserWithdrawService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * @author mipha
 * @version 1.0
 * @date 2019/3/4 6:14 PM
 */
@Controller
@RequestMapping("/agent/withdraw/")
@Slf4j
public class AgentWithdrawController {

    @Autowired
    IUserWithdrawService iUserWithdrawService;


    /**
     *  代理 查询用户出金列表
     * @param pageNum
     * @param pageSize
     * @param realName
     * @param state
     * @param agentId
     * @param request
     * @return
     */
    @RequestMapping("list.do")
    @ResponseBody
    public ServerResponse list(@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
                               @RequestParam(value = "pageSize", defaultValue = "8") int pageSize,
                               @RequestParam(value = "realName",required = false) String realName,
                               @RequestParam(value = "state",required = false) Integer state,
                               @RequestParam(value = "agentId",required = false) Integer agentId,
                               HttpServletRequest request){
        return iUserWithdrawService.listByAgent(agentId,realName,state,request,pageNum,pageSize);
    }




}
